/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package pmi.dao.koneksi;

import com.mysql.jdbc.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
import java.util.logging.Level;
import java.util.logging.Logger;


/**
 *
 * @author Whilda
 */
public class databaseutilities {
    static Connection conn;
    
    public static Connection getConnection() {
        if(null==conn){
            try {
                DriverManager.registerDriver(new com.mysql.jdbc.Driver());
                conn = (Connection) DriverManager.getConnection("jdbc:mysql://localhost:3306/pmi","root","");
                return conn;
            } catch (SQLException ex) {
                Logger.getLogger(databaseutilities.class.getName()).log(Level.SEVERE, null, ex);
                return null;
            }
            
                    
        }
        return conn;
    }
}
